package com.platform.tony.config;


import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;


/**
 * 微信登录方式 token
 */
@Getter
@Setter
public class WeChatAuthToken extends AbstractAuthenticationToken implements Serializable {


    private Collection<GrantedAuthority> authorities = new ArrayList<>();

    private Object principal;
    private Object credentials;
    private String openId;

    public WeChatAuthToken(String openId) {
        super(null);
        this.openId = openId;
    }

    @Override
    public Object getCredentials() {
        return this.credentials;
    }

    @Override
    public Object getPrincipal() {
        return this.principal;
    }
}
